package com.timoon.component.panel.grid.actions;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

import com.timoon.component.panel.grid.GridService;
import com.timoon.component.panel.grid.panel.AddPanel;

/**
 *<p></p>
 *<p></p>
 *<p>Copyright:Copyright(c)2013.4.1</p>
 *<p>Company:timoon</p>
 *@author 付乐天
 *@version 1.0 */
public class AddButton extends AjaxButton {

	private ModalWindow window;
	
	public AddButton(String id,GridService service,ModalWindow window) {
		super(id);
		// TODO Auto-generated constructor stub
		this.window=window;
		
	}
	
	@Override
	protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
		// TODO Auto-generated method stub
		super.onSubmit(target, form);
		window.show(target);
	}



}
